package com.lg.erp.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lg.erp.entity.SMenu;
import com.lg.erp.mapper.MenuMapper;
import com.lg.erp.service.IMenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ligen
 * @since 2021-04-12
 */
@Service
public class MenuServiceImpl extends ServiceImpl<MenuMapper,SMenu> implements IMenuService {

    @Autowired
    private MenuMapper mapper;

    @Override
    public List<SMenu> findFunctionsByUsername(String username){
      return mapper.selectFunctionsByUsername(username);
    }

    @Override
    public List<SMenu> findAllFunctions() {
        return mapper.selectAllFunctions();
    }

    @Override
    public List<SMenu> findFunctionsByRoleId(String id) {
        return mapper.selectFunctionsByRoleId(id);
    }

    @Override
    public IPage<SMenu> getFunctionsByPage(Page<SMenu> page) {
        return mapper.selectFunctionsByPage(page);
    }
}
